home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / me_cd25.zip / MUTT2.ZIP / REQUIRE.MUT < prev    next >
Text File  |  1992-11-09  |  1KB  |  33 lines

  1. ;; require.mut : Lisp like require.  This code lets Mutt programs require
  2. ;;   that certain modules or routines be loaded.
  3. ;; To use:  In the MAIN rouine of your program file, add
  4. ;;   (require Mutt-module-needed-by-this-program .mco-file-module-is-in)
  5. ;;   where:
  6. ;;     Mutt-module-needed-by-this-program is the name of a routine in the
  7. ;;       module.
  8. ;;     .mco-file-module-is-in is the name of the file that contains the
  9. ;;       code for the module.
  10. ;; For example:  If MAIN contains (require "foo" "bar.mut") or (require
  11. ;;   "foo" "bar")), when your program is loaded it will load foo.mco if it
  12. ;;   hasn't been already or routine foo is not present.
  13. ;; Notes:
  14. ;;   It would be a good idea to also implememnt (provide ...) so I could
  15. ;;     use a module name instead of mickey mousing with a routine name
  16. ;;     (which might be screwed up by autoload).  I could do this with a
  17. ;;     list.
  18. ;; C Durland  10/89  redone 9/91, 8/92    Public Domain
  19.  
  20. (defun
  21.   require (string Mutt-module Mutt-code-file)
  22.   {
  23.     (if (pgm-exists Mutt-module) (done))
  24.  
  25.     (arg-prefix 42)            ;; secret code to maybe load
  26.     (if (not (load Mutt-code-file))    ;; if can't load code
  27.       {
  28.         (msg "require: Could not load " Mutt-code-file)
  29.     (halt)
  30.       })
  31.   }
  32. )
  33.